const Shell = imports.gi.Shell;
const Gdk = imports.gi.Gdk;
-const AppDisplay = imports.ui.appDisplay;
const Dash = imports.ui.dash;
const DND = imports.ui.dnd;
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
const Panel = imports.ui.panel;
const Params = imports.misc.params;
-const PlaceDisplay = imports.ui.placeDisplay;
-const RemoteSearch = imports.ui.remoteSearch;
const Tweener = imports.ui.tweener;
const ViewSelector = imports.ui.viewSelector;
-const Wanda = imports.ui.wanda;
-const WorkspacesView = imports.ui.workspacesView;
const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
// Time for initial animation going into Overview mode
this._capturedEventId = 0;
this._buttonPressId = 0;
- this._workspacesDisplay = null;
-
this.visible = false; // animating to overview, in overview, animating out
this._shown = false; // show() and not hide()
this._shownTemporarily = false; // showTemporarily() and not hideTemporarily()
this._viewSelector = new ViewSelector.ViewSelector();
this._group.add_actor(this._viewSelector.actor);
- this._workspacesDisplay = new WorkspacesView.WorkspacesDisplay();
- this._viewSelector.addViewTab('windows', _("Windows"), this._workspacesDisplay.actor, 'text-x-generic');
-
- let appView = new AppDisplay.AllAppDisplay();
- this._viewSelector.addViewTab('applications', _("Applications"), appView.actor, 'system-run');
-
- // Default search providers
- // Wanda comes obviously first
- this.addSearchProvider(new Wanda.WandaSearchProvider());
- this.addSearchProvider(new AppDisplay.AppSearchProvider());
- this.addSearchProvider(new AppDisplay.SettingsSearchProvider());
- this.addSearchProvider(new PlaceDisplay.PlaceSearchProvider());
-
- // Load remote search providers provided by applications
- RemoteSearch.loadRemoteSearchProviders(Lang.bind(this, this.addSearchProvider));
-
// TODO - recalculate everything when desktop size changes
this._dash = new Dash.Dash();
this._group.add_actor(this._dash.actor);
Lang.bind(this, this._onButtonPress));
},
+ fadeInDesktop: function() {
+ this._desktopFade.opacity = 0;
+ this._desktopFade.show();
+ Tweener.addTween(this._desktopFade,
+ { opacity: 255,
+ time: ANIMATION_TIME,
+ transition: 'easeOutQuad' });
+ },
+
+ fadeOutDesktop: function() {
+ if (!this._desktopFade.child)
+ this._desktopFade.child = this._getDesktopClone();
+
+ this._desktopFade.opacity = 255;
+ this._desktopFade.show();
+ Tweener.addTween(this._desktopFade,
+ { opacity: 0,
+ time: ANIMATION_TIME,
+ transition: 'easeOutQuad'
+ });
+ },
+
_animateVisible: function() {
if (this.visible || this.animationInProgress)
return;
global.window_group.hide();
this._group.show();
this._background.show();
-
- this._workspacesDisplay.show();
-
- if (!this._desktopFade.child)
- this._desktopFade.child = this._getDesktopClone();
-
- if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows()) {
- this._desktopFade.opacity = 255;
- this._desktopFade.show();
- Tweener.addTween(this._desktopFade,
- { opacity: 0,
- time: ANIMATION_TIME,
- transition: 'easeOutQuad'
- });
- }
+ this._viewSelector.show();
this._group.opacity = 0;
Tweener.addTween(this._group,
this.animationInProgress = true;
this._hideInProgress = true;
- if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows()) {
- this._desktopFade.opacity = 0;
- this._desktopFade.show();
- Tweener.addTween(this._desktopFade,
- { opacity: 255,
- time: ANIMATION_TIME,
- transition: 'easeOutQuad' });
- }
-
- this._workspacesDisplay.zoomFromOverview();
+ this._viewSelector.zoomFromOverview();
// Make other elements fade out.
Tweener.addTween(this._group,
global.window_group.show();
- this._workspacesDisplay.hide();
-
+ this._viewSelector.hide();
this._desktopFade.hide();
this._background.hide();
this._group.hide();
const Shell = imports.gi.Shell;
const St = imports.gi.St;
+const AppDisplay = imports.ui.appDisplay;
const Main = imports.ui.main;
+const PlaceDisplay = imports.ui.placeDisplay;
+const RemoteSearch = imports.ui.remoteSearch;
const Search = imports.ui.search;
const SearchDisplay = imports.ui.searchDisplay;
const ShellEntry = imports.ui.shellEntry;
const Tweener = imports.ui.tweener;
+const Wanda = imports.ui.wanda;
+const WorkspacesView = imports.ui.workspacesView;
const BaseTab = new Lang.Class({
Name: 'BaseTab',
this._switchTab(this._activeTab);
}));
+ this._workspacesDisplay = new WorkspacesView.WorkspacesDisplay();
+ this._windowsTab = new ViewTab('windows', _("Windows"), this._workspacesDisplay.actor, 'text-x-generic');
+ this._addViewTab(this._windowsTab);
+
+ let appView = new AppDisplay.AllAppDisplay();
+ this._appsTab = new ViewTab('applications', _("Applications"), appView.actor, 'system-run');
+ this._addViewTab(this._appsTab);
+
+ // Default search providers
+ // Wanda comes obviously first
+ this.addSearchProvider(new Wanda.WandaSearchProvider());
+ this.addSearchProvider(new AppDisplay.AppSearchProvider());
+ this.addSearchProvider(new AppDisplay.SettingsSearchProvider());
+ this.addSearchProvider(new PlaceDisplay.PlaceSearchProvider());
+
+ // Load remote search providers provided by applications
+ RemoteSearch.loadRemoteSearchProviders(Lang.bind(this, this.addSearchProvider));
+
Main.overview.connect('item-drag-begin',
Lang.bind(this, this._switchDefaultTab));
coordinate: Clutter.BindCoordinate.HEIGHT });
},
+ show: function() {
+ this._workspacesDisplay.show();
+
+ if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
+ Main.overview.fadeOutDesktop();
+ },
+
+ zoomFromOverview: function() {
+ this._workspacesDisplay.zoomFromOverview();
+
+ if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
+ Main.overview.fadeInDesktop();
+ },
+
+ hide: function() {
+ this._workspacesDisplay.hide();
+ },
+
_addTab: function(tab) {
tab.page.hide();
this._pageArea.add_actor(tab.page);
}));
},
- addViewTab: function(id, title, pageActor, a11yIcon) {
- let viewTab = new ViewTab(id, title, pageActor, a11yIcon);
+ _addViewTab: function(viewTab) {
this._tabs.push(viewTab);
this._tabBox.add(viewTab.title);
this._addTab(viewTab);